package com.heather.exam.controller.admincontroller;

import com.heather.exam.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

        @Autowired
        private UserMapper userMapper;

        @PutMapping("/users/{userId}/freeze")
        public ResponseEntity<String> freezeAccount(@PathVariable int userId) {
            userMapper.freezeAccount(userId);
            return ResponseEntity.ok("User account frozen successfully.");
        }
    }


